import { createApp } from 'vue'

// import 'element-plus/packages/theme-chalk/src/base.scss'
// const { mockXHR } = require('../mock')
// mockXHR()

import components from '@/components'
import '@/icons/index'
// 统一界面样式1
import 'normalize.css/normalize.css'

import App from './App.vue'
import router from '@/router'
import store from '@/store'
// import print from 'vue3-print-nb'

// import { loadAllPlugins } from './plugins'

import '@/premission'
import '@/styles/index.scss'

import 'vue-video-player/src/custom-theme.css'
import 'video.js/dist/video-js.css'
import videoPlayer from 'vue-video-player/src'

// // 将vue所有的关键字导入全局
// import 'vue-global-api'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// import zhCn from 'element-plus/es/locale/lang/zh-cn'

// ElementPlus兼容包
import ResizeObserver from 'resize-observer-polyfill'
window.ResizeObserver = ResizeObserver

// 某些方法兼容 replaceAll
import 'core-js'
import 'regenerator-runtime/runtime'
const app = createApp(App)
  .use(router)
  .use(store)
  .use(videoPlayer)
  .use(ElementPlus)
// loadAllPlugins(app)
app.mount('#app')
app.use(components)

import GlobDirective from './directive/index.vue'
// TODO 设置为any是为了 暂时兼容ts调用js 后续熟悉后再改
function directiveFN(app: any) {
  app.use(GlobDirective)
}
directiveFN(app)

import ReferralOut from './components/ReferralOut/index.vue'
app.component('referralOut', ReferralOut)

import ImgFileUpLoad from '@/components/ImgFileUpload/index.vue'
app.component('ImgFileUpLoad', ImgFileUpLoad)

import { setupRouterGuard } from '@/router/guard/index.js'
setupRouterGuard(router)
